package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Tag;
import cn.wolfcode.trip.base.mapper.TagMapper;
import cn.wolfcode.trip.base.service.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TagServiceImpl implements ITagService {
    @Autowired
    private TagMapper tagMapper;

    public List<Tag> getTagsByState(Integer state,Long strategyId) {
        return tagMapper.getTagsByState(state,strategyId);
    }

    @Override
    public void save(Tag tag) {
       tagMapper.insertByName(tag);
    }

    @Override
    public void saveForCommentTag(Long iagId, Long commentId) {
        tagMapper.insertForCommentTag(iagId,commentId);
    }
}
